package com.tinyengine.it.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.tinyengine.it.common.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Map;

/**
 * API 接口管理表
 *
 * @TableName i_api_endpoints
 */
@TableName(value = "i_api_endpoints")
@Data
public class ApiEndpoints extends BaseEntity {
    /**
     * 项目、服务信息ID
     */
    private Integer directoryId;

    /**
     * 状态 ENUM(0-开发中, 1-已完成, 2-需修改, 3-已废弃)
     */
    @Schema(description = "0-开发中, 1-已完成, 2-需修改, 3-已废弃")
    private Integer status;

    private String name;

    private String code;

    /**
     * 描述
     */
    private String description;

    /**
     * 头部
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> header;

    /**
     * 查询参数
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> queryParams;

    /**
     * 路径参数
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> pathParams;

    /**
     * 请求体
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> requestBody;

    /**
     * 方法（get、post）
     */
    private String method;

    /**
     * 接口请求路径
     */
    private String pathReq;

    /**
     * 返回体
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, Object> responseBody;


}